﻿using System;
using System.IO;
using System.Security;

class FileReadException
{
    static void Main()
    {
        Console.Write("Enter the full file path: ");

        string fPath = Console.ReadLine();
        
        try
        {
            string fContent = File.ReadAllText(fPath);

            Console.WriteLine("The file content is: ");
            Console.WriteLine(fContent);
        }

        catch (ArgumentNullException)
        {
            Console.WriteLine("No file path entered!");
        }

        catch (ArgumentException)
        {
            Console.WriteLine("Invalid file path!");
        }

        catch (DirectoryNotFoundException)
        {
            Console.WriteLine("A directory in the file path cannot be found!");
        }

        catch (FileNotFoundException)
        {
            Console.WriteLine("The file was not found!");
        }

        catch (PathTooLongException)
        {
            Console.WriteLine("The file path is too long!");
        }

        catch (UnauthorizedAccessException ue)
        {
            Console.WriteLine(ue.Message);
        }

        catch (SecurityException)
        {
            Console.WriteLine("You don't have the required permission to access this file!");
        }

        catch (NotSupportedException)
        {
            Console.WriteLine("Invalid file path format!");
        }

        catch (IOException ioe)
        {
            Console.WriteLine(ioe.Message);
        }
    }
}
